package org.simplecrm.domain.event;

import org.simplecrm.domain.event.eventtype.EventType;

import java.io.Serializable;
import java.util.Date;

/**
 * Event entity.
 */
public class Event implements Serializable {

    private Integer id;
    private EventType type;
    private String description;
    private Date creationDate;
    private EventStatus status;
    private Integer customerId;
    private Integer supportId;

    public Event() {
    }

    public Event(Integer id) {
        setId(id);
    }

    public Event(Integer id, EventType type, String description, Date creationDate,
                 EventStatus status, Integer customerId) {

        setId(id);
        setType(type);
        setDescription(description);
        setCreationDate(creationDate);
        setStatus(status);
        setCustomerId(customerId);
    }

    public Event(Integer id, EventType type, String description, Date creationDate,
                 EventStatus status, Integer customerId, Integer supportId) {

        this(id, type, description, creationDate, status, customerId);
        setSupportId(supportId);
    }

    public Integer getSupportId() {
        return supportId;
    }

    public void setSupportId(Integer supportId) {
        this.supportId = supportId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public EventType getType() {
        return type;
    }

    public void setType(EventType type) {
        this.type = type;
    }

    public EventStatus getStatus() {
        return status;
    }

    public void setStatus(EventStatus status) {
        this.status = status;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }


    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Event)) {
            return false;
        }
        Event other = (Event) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Event{" +
                "id=" + id +
                ", type=" + type +
                ", description='" + description + '\'' +
                ", creationDate=" + creationDate +
                ", status=" + status +
                ", customerId=" + customerId +
                ", supportId=" + supportId +
                '}';
    }
}
